HWJ13_Timing
Create an applet that when the applet is loaded, it will have a ball randomly drop from the sky (top of screen, random x). The ball will bounce half as high as how far it dropped. So the first time, it will drop 500 pixels and bounce up 250 then drop down 250, then up 125, then down 62, and so on until the ball is on the ground.
Start with the code from timing.
The global variables you probably need are:
boolean isMovingUp=false;
int bounceHeight=250;
int x=(int)(Math.random()*500);
int y=0;
High flyers (you know who you are): create an applet that will show the second hands of a clock: this.
|